package com.demo.designpattern.strategypattern;

public class ClientWithLambda {
    public static void main(String[] args) {
        Validator numbericValidator = new Validator((String s) -> s.matches("\\d+"));
        boolean b1 = numbericValidator.validate("123");
        Validator lowerCaseValidator = new Validator((String s) -> s.matches("[a-z]+"));
        boolean b2 = lowerCaseValidator.validate("aBed");
        System.out.println(b1);
        System.out.println(b2);
    }
}
